package com.fang.fen.test.proxy.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ProxyCook implements InvocationHandler {


    private ICook target;

    public ProxyCook(ICook target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("before");
        Object res = method.invoke(target, args);
        System.out.println("after");
        return res;
    }
}
